﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BSpec.Conventions
{
    public class DefaultNamingConvention : NamingConvention
    {
        public DefaultNamingConvention()
        {
            this.WithConcerns(c => c
                    .AddMatching(@"(\w+)(?=specs?)")
                    .AddMatching(@"(\w+)(?=tests?)"))
                .WithScenarios(s => s
                    .AddMatching(@"(?<=with_scenario_of\.)(\w+)")
                    .AddMatching(@"(?<=when)(\w+)"))
                .WithContexts(c => c
                    .AddMatching(@"(?<=\.)given(\w+)((?:\.and\w+)?)+"))
                .WithBehaviours(b => b
                    .AddMatching(@"(?<=\.)when(\w+)"));
        }
    }
}
